import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { DICT } from '/@/enums/dict';
import { getDictTypeListApi } from '/@/api/admin/dict';

export const columns: BasicColumn[] = [
  {
    title: '模型名称',
    dataIndex: 'modelName',
    width: 300,
  },
  {
    title: '模型代码',
    dataIndex: 'modelCode',
    width: 180,
  },
  {
    title: '客户端类型',
    dataIndex: 'clientName',
    width: 100,
  },
  {
    title: '业务分类',
    dataIndex: 'modelTypeName',
    width: 180,
  },

  {
    title: '更新时间',
    dataIndex: 'editDate',
    width: 180,
  },

  {
    title: '备注',
    dataIndex: 'modelDesc',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'client',
    label: '客户端类型',
    component: 'ApiSelect',
    labelWidth: 90,
    colProps: { span: 4, xxl: 4, sm: 6 },
    componentProps: {
      api: getDictTypeListApi,
      valueField: 'intValue',
      params: {
        type: DICT.CLIENT_TYPE,
      },
    },
  },
  {
    field: 'modelName',
    label: '模型名称',
    component: 'Input',
    labelWidth: 68,
    colProps: { span: 6 },
    componentProps: {
      placeholder: '请输入模型名称',
    },
  },
];
